package com.itheima.server.imp;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.mapper.NursingLevelMapper;
import com.itheima.pojo.NursingLevel;
import com.itheima.pojo.NursingPage;
import com.itheima.pojo.NursingProject;
import com.itheima.pojo.PageResult;
import com.itheima.server.INursingLevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class INursingLevelServiceImpl extends ServiceImpl<NursingLevelMapper, NursingLevel> implements INursingLevelService {
    @Autowired
    private NursingLevelMapper nursingLevelMapper;
    @Override
    public PageResult<NursingLevel> getList(NursingPage nursingPage) {
        PageHelper.startPage(nursingPage.getPage(),nursingPage.getPageSize());
        List<NursingLevel> List = nursingLevelMapper.getlist(nursingPage);
        Page<NursingLevel> p = (Page<NursingLevel>) List;
        return new PageResult<>(p.getTotal(), List);
    }
}
